-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding new KeepTree flag - allows to preserve tree struct for mocks #175
Conversation
I'm still testing it a bit more but would love to hear if this is something that could benefit more people. |
* Using the keeptree flag allows to generate mocks in a different directory but keeping the original structure of the repo that is being mocked. * Very useful for kubernetes client-go that has sometimes 3 versions of the same interface name hence requires different folders. Easiest way is to keep the same tree structure as if it was "inPlace". * KeepTree flag is most useful when used with -all, -dir and -output.
545edbc
to
126a261
Compare
@evanphx any opinion? |
I have several interfaces with the same name causing a name conflict as described here: I tried using your branch with the keeptree flag but nothing changed, a single file was created under the mocks folder. I created a simple repository to reproduce the issue: Is your PR supposed to fix those kind of conflicts as well? |
@jybp sorry for the delayed reply. This worked for me: KeepTree is good when you want to bulk generate all the mocks.
|
Allow the generation of mocks for generics as introduced in golang 1.18
Allow the generation of mocks for generics as introduced in golang 1.18
Allow the generation of mocks for generics as introduced in golang 1.18
Allow the generation of mocks for generics as introduced in golang 1.18
Allow the generation of mocks for generics as introduced in golang 1.18
Allow the generation of mocks for generics as introduced in golang 1.18
Using the keeptree flag allows to generate mocks in a different
directory but keeping the original structure of the repo that is being mocked.
Very useful for kubernetes client-go that has sometimes 3 versions of the
same interface name hence requires different folders. Easiest way is to keep the
same tree structure as if it was "inPlace".
KeepTree flag is most useful when used with -all, -dir and -output.